import {Component, OnInit, ViewChild} from '@angular/core';
import {ActionPanelComponent} from '../../components/action-panel/action-panel.component';
import {BasePage} from '../../common/basePage';
import {NavController, ToastController} from '@ionic/angular';

/**
 * 出借页面（目前弃用）
 */
@Component({
  selector: 'app-bid-purchase',
  templateUrl: './bid-purchase.page.html',
  styleUrls: ['./bid-purchase.page.scss'],
})
export class BidPurchasePage extends BasePage implements OnInit {

  @ViewChild(ActionPanelComponent) actionPanel;

  dataList = [
    {
      id: '1',
      name: '建设银行储蓄卡(4760)'
    },
    {
      id: '2',
      name: '廊坊银行储蓄卡(5566)'
    }
  ];

  cardInfo = {
    id: '1',
    name: '建设银行储蓄卡(4760)'
  };

  constructor(public navCtrl: NavController,
              public toastCtrl: ToastController) {
    super(navCtrl, toastCtrl);
  }

  ngOnInit() {
  }

  openCardList() {
    this.actionPanel.showActionPanel();
  }

  changeCard(cardInfo) {
    this.cardInfo = cardInfo;
    this.actionPanel.hideActionPanel();
  }

  addCard() {
    console.log('前往资金存管系统');
  }

}
